import 'package:flutter/material.dart';

class CcButton extends StatelessWidget {
  final String title; // 按钮上的文字
  final bool enable; // 按钮是否可用
  final VoidCallback? onPressed; // 按钮点击的回调函数

  const CcButton(this.title,{Key? key,this.enable = true,this.onPressed}):super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialButton(
      shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
      height: 45,
      onPressed: enable ? onPressed : null,
      disabledColor: Colors.white60,
      color: Colors.orange,
      child: Text(title, style: TextStyle(color: Colors.white, fontSize: 16)),
    );
  }
}
